Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MoMo Type System and PCB Build System #26

Merged
merged 1 commit into from
Mar 14, 2015
Merged

Update MoMo Type System and PCB Build System #26

merged 1 commit into from
Mar 14, 2015

Conversation

timburke
Copy link
Contributor

In order to remove our current dependency on Digikey part numbers to identify components on our boards and allow other distributors, this PR refactors and updates the pcb build system as well as updating the momo type annotation system to make developing API functions easier.

The main changes are listed below

Type System

  • You can have complex types that are compositions of basic types like list(string) or map(string, string). This is really useful for returning complex values from an API function but still being able to automatically print them in the console if you run from momo without giving you useless information (like a pile of strings) if you call from a python script.
  • Refactored the type system into a more user friendly interface and added unit tests
  • Added more types like boolean, maps, lists

Outstanding feature requests are documented in #25.

MoMo Tool

  • Fixed --rcdir to --rcfile. Closes Change --rcdir argument to --rcfile since it's actually a file #20
  • Lazily load modules on demand rather than loading everything at startup to reduce startup time. This will be really important going forward but is useful now too. Modules are now only loaded the first time that a context loaded from that module is invoked.
  • Added momo pcb context that houses all of the pcb related functionality
  • Fixed momo tool usage on Windows so that it works (related to readline vs. libedit issues)

Outstanding feature requests are documented in #24.

PCB Build System

  • Refactored everything and removed dependency on EAGLE and Octopart. Now you can use whatever ECAD program you want, provided it has an adapter. Similar for Octopart, though there aren't too many options here.
  • Removed the assumption that all parts would have a Digikey part number. Now you can use a combination of Manufacturer, MPN or Distributor, Distributor Part Number to identify a part.
  • Added a lot of unit tests
  • Added documentation for how to use pymomo.pcb from the command line
  • Removed dependency on huge ZODB for caching. Use a simpler cache based on sqlite (part of python standard library)
  • Add generation of excel BOMs directly rather than just CSV files since everyone wants excel BOMs (using xlsxwriter package)

Outstanding feature requests for pcb are documented in #23.

Documentation for pcb feature is included as a separate PR to MoMo-Firmware since it currently needs to live in that repo

@timburke
Copy link
Contributor Author

Once this gets looked over, I'll update the version number and squash it.
Edit: Squashed now to make it easier to work with.

- Added generic BOMMatcher with Octopart implementation
- Moved caching to a higher layer
- Made the interface compatible with typedargs

Update typedargs with class containing type_system code

- Also expand unit test coverage of type system
- Add default string formatting for exceptions

Update for more consistent use of new type_system

Add initial support for complex types

- Add a map type that can take any two other types as key and value types

Add typed return values to type system

Update bom_matcher to use typed return value

Update typedargs to export return_type

Update typesystem to allow complex types in param and return_type

Fix return value printing

Begin creating provider-agnostic part information

Add list complex type to typedargs

Finish refactoring octopart code
- Start refactoring board extraction and pricing code

Refactored pybom
- Added momo friendly CircuitBoard object
- Simplified generation of pricing models
- Consolidated code for getting bom information

rename bom_lines() to capture what it does

Fix improper location of config file

Start finishign up pcbtool

Fix help display in momo tool.

Remove dirspec dependency and replace with in-house alternative

Update README to remove mention of dirspec

Update typedargs with class containing type_system code

- Also expand unit test coverage of type system
- Add default string formatting for exceptions

Fix improper location of config file

Update for more consistent use of new type_system

Add initial support for complex types

- Add a map type that can take any two other types as key and value types

Update typedargs to export return_type

Update typesystem to allow complex types in param and return_type

Fix help display in momo tool.

Add bool type

Don't require a variant when there is only one option

Add test for circuitboard

- start work on partcache, moving from ZODB to integrated sqlite

Recreate cache functionality on top of sqlite

Still need to integrate into bommatching

Start making CircuitBoard agnostic of the generating program.

Begin the great refactor to make CircuitBoard agnostic of the
type of board file that it was generated from.  This does not
work yet but is on its way.

Rename pybom to pcb

Working version of refactored CircuitBoard

Attribute updating works now on eagle board files

Integrate part cache into bom matching object

Working version of part caching

Working partcache integrated into bom_matcher

Working part caching and unit tests for part matching

Rename unit tests from pybom to pcb to match new package name

Update TODO status

Add support for updating metadata in boards and writing BOM lines

Fix unit tests and partcache to use global defaults

Fix unit tests for pcb tools

Fix refactor copy/paste error and remove unnecessary setup dependencies

Working excel exporting of BOMs

Pump version 1.1.0 since we added a new bom feature

Add unit test to exercise excel exporting

Fix bug handling empty manufacturers

Fix processing of assembly variants in eagle and add tests for it

Update CircuitBoard to support pricing BOMs

- Also fix issue with unicode display inside physical parts objects
not being converted correctly to ascii when using __str__
- Updated type system to include price objects.

Update momo to only display traceback information during an APIError

Starting work on integrating fab and assy drawing generation

Additional work on fab generation

Update momo tool to lazily load modules when possible

This cuts the startup time in half and will be very important going
forward to make sure we keep the tool responsible and speedy

Working version of production file generation

Add unit test for building production files

- note: EAGLE needs brd files to be named .brd for CAM processing to work

Remove non conforming exception and update TODO docs

Update production generation to zip up result

Fix libedit logic to only apply on mac os x and not on Windows too

Start autofinding EAGLE on various OS

Add eagle autofind on mac os x in standard location

Update version number

Update modtool to show progress bars
@timburke
Copy link
Contributor Author

Updated PR to fix an issue with modtool not showing progress bars.

amcgee added a commit that referenced this pull request Mar 14, 2015
Update MoMo Type System and PCB Build System
@amcgee amcgee merged commit 9c7e1cf into WellDone:master Mar 14, 2015
@amcgee
Copy link
Member

amcgee commented Mar 14, 2015

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change --rcdir argument to --rcfile since it's actually a file
2 participants